package com.joshondesign.sdljava.gfx;

import com.joshondesign.sdljava.SDL;
import com.joshondesign.sdljava.SDL_Surface;

import java.io.File;

import static com.joshondesign.sdljava.SDLUtil.p;

/**
 * Created by IntelliJ IDEA.
 * User: josh
 * Date: 9/13/11
 * Time: 8:54 AM
 * To change this template use File | Settings | File Templates.
 */
public class SPattern implements SPaint {
    private SDL_Surface _sdlimage;

    public SPattern(File file) {
        p("loading pattern image: " + file.getAbsolutePath());
        if(!file.exists()) {
            p("WARNING: file doesn't exist= ");
        }
        SDL_Surface image = SDL.IMG_Load(file.getAbsolutePath());
        this._sdlimage = image;
    }

    public SDL_Surface getImage(SDL_Surface surface) {
        return _sdlimage;
    }
}
